/*
 * @Author: niuxb 951259738@qq.com
 * @Date: 2022-06-07 09:36:04
 * @LastEditors: niuxb 951259738@qq.com
 * @LastEditTime: 2022-06-24 14:46:44
 * @FilePath: /syq/src/router/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout/Layout';

Vue.use(Router)
export const constantRouterMap = [
  
  {
    path: '',
    redirect: '/tabview'
  },{
    path:'/detail',
    name: 'detail',
    component: () => import('@/views/detail')
},{
  path:'/xgplayer',
  name: 'xgplayer',
  component:()=> import('@/components/xgPlayer')
},{  //tab页
    path:'/tabview',
    name: 'tabview',
    component: () => import('@/views/todoList'),
    // component: Layout,
    // children: [{
    //   meta: {
    //     title: '党建视频列表',
    //     keepAlive: true
    //   },
    //   path: '',
    //   name: 'tabview',
    //   component: () => import('@/views/todoList'),
    // }]
  },{
  path:'/fileview',
  component:Layout,
  children:[
    {
      meta:{
        title:'附件详情',
        layoutName:'fileview',
      },
      name:'fileview',
      path:'',
      component:()=>
      import('@/views/fileview')
    },
  ],
},{
    path: '/success',
    component: Layout,
    children: [{
      meta: {
        title: '提示'
      },
      name: 'success',
      path: '',
      component: () => import('@/views/success')
    }]
  }
];

export default new Router({
  routes: constantRouterMap,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  }
})